package it.cnr.icib.xsbjdbc;


import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/*
 * SqlLiteDAO_Operations.java
 *
 * Created on 24 settembre 2007, 14.28
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */






/**
 *
 * @author Nino
 */
public class SqlLiteDAO_Operations implements DBOperations{
    
    
    static Statement stm=null;
    
    static Connection conn=null;
    /**
     * Creates a new instance of SqlLiteDAO_Operations
     */
    public SqlLiteDAO_Operations() {
        conn=SqlLiteDAO_TaskModel.getConn();
        stm=SqlLiteDAO_TaskModel.getStatement();

        //stm=PostgreSqlDAO_Car_Washing.getStatement();
    }

    @Override
    public void insertTaskModel() {
        try {
            stm.executeUpdate("insert into TaskModel (domain, description) VALUES ('Gandhi', 'Mahatma')");
        } catch (SQLException ex) {
            Logger.getLogger(SqlLiteDAO_Operations.class.getName()).log(Level.SEVERE, null, ex);
        }
       
    }

	
	public ResultSet getTaskModel() {
		// TODO Auto-generated method stub
		ResultSet rs = null;
		try {
			rs=stm.executeQuery("Select * From TaskModel");
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return rs;
		
	}
    
        
}





